<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>个人中心</span>
      </div>
    </template>
    <div class="user-profile">
      <el-avatar :size="100" :src="user.avatar"></el-avatar>
      <div class="user-info">
        <p><strong>账号:</strong> {{ user.username }}</p>
        <p><strong>昵称:</strong> {{ user.nickname }}</p>
        <p><strong>手机:</strong> {{ user.phone }}</p>
        <p><strong>邮箱:</strong> {{ user.email }}</p>
        <p><strong>角色:</strong> {{ user.role }}</p>
      </div>
    </div>
  </el-card>
</template>

<script setup>import { ref } from 'vue';
import { ElCard, ElAvatar } from 'element-plus';

const user = ref({
  username: 'zhang.san',
  nickname: '张三',
  phone: '13800000000',
  avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
  role: '超级管理员',
  email: 'zhangsan@example.com'
});
</script>

<style scoped>
.box-card {
  width: 400px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-profile {
  display: flex;
  align-items: center;
}

.user-info {
  margin-left: 20px;
}
</style>